The slope of a line is the tangent of the angle that the line makes with the $x$-axis as it crosses that
axis. If the line never crosses the $x$-axis, it has a slope of zero to indicate that it is parallel to the
$x$-axis. The convention is to measure the line angle counter-clockwise starting to the right of where
it crosses the axis.
Example: Suppose we are given
information that a line makes an angle of $15$ degrees as it crosses the $x$-axis and that it passes
through the point $(4,4).$ What is the equation of the line? Answer: From the definition of $slope=tan(\alpha)$ where
$\alpha$ is the angle to the $x$-axis, we should use a calculator (or table) to see that the
$\tan(15deg)=0.268=slope.$ From the slope intercept form, $y=m\cdot x+b,$ we substitute in
the known point $(4,4)$ for $x$ and $y$ and solve for $b$. $b=4-0.268\cdot4=2.928.$ The
line equation is $y=0.268\cdot x+2.928.$
If we have two lines that cross each other then the difference in their angles, $\alpha_{1}-\alpha_{2},$ is the acute angle between them. $\alpha$ continues to be the angle that the line makes with the $x$-axis. Each angle is given by $\alpha=atan(slope).$ If the slope is negative then $\alpha=atan(slope)+pi.$
Example 2 Suppose two lines with slopes $m_{1}=7,$ and $m_{2}=3.$ What is the acute angle between these lines.
Answer: The easy way is just to determine the angle of each line and then subtract them.
$\alpha_{1} = atan(7) = 81.87^{\circ}$
$\alpha_{2} = atan(3) = 71.565^{\circ}$
$(\alpha_{1}-\alpha_{2}) = 10.305^{\circ}$
If the answer is greater than $90^{\circ}$, then subtract the answer from $180^{\circ}$ to get the acute angle, or just reverse the $\alpha$'s in the subtraction. It is also possible, but not necessary to use the $\text{atan2}$ function to do the same thing, but in that case, since the function needs two inputs one must use as arguments, $\text{atan2}(slope,1).$ For this problem, there is no advantage to using $\text{atan2}.$
Although the above method is quite easy, there is another method that is often used and in my opinion, with little justification. This section is ignoring an even easier method for solving this problem, which comes from an angle between two vectors. If the angle, $\alpha,$ is our answer and therefore $\alpha = \alpha1-\alpha2,$ then it is also true that I can write the tangent of both sides and preserve the equality:
$$\tan(\alpha)=\tan(\alpha1-\alpha2). \tag{1} \label{1}$$
There is a trig identity:
$$\tan(a-b)=\frac{{\textstyle \tan(a)-\tan(b)}}{{\textstyle \tan(a)\tan(b)+1}} \tag{2} \label{2}$$
Notice that each slope, $m1$ & $m2,$ corresponds to $\tan(a)$ and $\tan(b)$ in the identity. Therefore by substitution into Equation $\eqref{2}$ of $m1$ for $\tan(a)$ and $m2$ for $\tan(b)$ , we get:
$$\tan(\alpha1-\alpha2)=\frac{{\textstyle m1-m2}}{{\textstyle 1+m1\cdot m2}} \tag{3} \label{3}$$
and
$$\alpha1-\alpha2=\text{atan}\left|\frac{m1-m2}{1+m1\cdot m2}\right|$$
Absolute value is used because angles in this concept are not negative. Since it is necessary under both methods to use a trig function, it seems easier to use the arctan twice and subtract as in example 2, rather than making a ratio of the slopes.